class ExtendAdTables < ActiveRecord::Migration
  def self.up
    add_column :ads, :startdate, :datetime
    remove_column :ads, :shipping_cost
    remove_column :ads, :shipping_method_id
    
    rename_table(:auction_ads, :auctions)
    add_column :auctions, :reservation, :integer
    add_column :auctions, :bid, :float
    remove_column(:auctions, :timeout)

    create_table :dynamic_auctions, :primary_key => :dynamic_auction_id do |t| end
    add_column :dynamic_auctions, :timeout, :integer
    add_column :dynamic_auctions, :auction_id, :integer

    rename_table(:buy_now_ads, :fixeds)

    create_table :fixed_auctions, :primary_key => :fixed_auction_id do |t| end
    add_column :fixed_auctions, :fixed_id, :integer
    add_column :fixed_auctions, :auction_id, :integer

    create_table :fixed_ads, :primary_key => :fixed_ad_id do |t| end
    add_column :fixed_ads, :fixed_id, :integer
    add_column :fixed_ads, :ad_id, :integer

    create_table :relaxeds, :primary_key => :relaxed_id do |t| end
    add_column :relaxeds, :price, :float
    add_column :relaxeds, :ad_id, :float
  end

  def self.down
  end
end
